TCLM_INTERFACE
Section: C Library Functions (3)
Index
Return to Main Contents
BSD mandoc
TCLM
April 20, 1993
NAME
tclm_interface
- function hooks to interface tclm to a MIDI device
SYNOPSIS
Fd #include <mdevice.h>
Fd typedef enum {PLAY, RECORD, PLAYRECORD} PlayMode
Ft int
Fn play_tracks int dev TCHUNK *tracks int *indices int num int repeat
Ft int
Fn record_tracks int dev TCHUNK *p_tracks int *indices int p_num TCHUNK *r_track int repeat
Ft int
Fn stop_processing int dev
Ft int
Fn open_midi_device PlayMode mode
Ft int
Fn init_midi_device int dev HCHUNK *hd double reltempo
Ft int
Fn start_midi_device int dev PlayMode mode
Ft int
Fn stop_midi_device int dev PlayMode mode
Ft int
Fn close_midi_device int dev
DESCRIPTION
play_tracks
Fn play_tracks
provides the functionality to convert events in
Standard
MIDI
File
( SMF )
form to a form
the
MIDI
device wants, and to send the converted
events to the device to be played.
The
dev
argument specifies the
MIDI
device that the
events will be sent to.
This value is what was returned from
Fn open_midi_device .
The second argument,
tracks
is a pointer to a list of
SMF
tracks as
found in
MIDI
files.
indices
is a pointer to a list of indices to the
tracks
Each index is the index number of a track
that should be played.
The fourth argument,
num
is the number of indices pointed to by
indices
It is also the number of tracks to play.
repeat
the final argument is a boolean value.
If it is true it signifies that the tracks
should be replayed when they reach their
end.
Fn play_tracks
does not send the actual commands
to start and stop playing.
It only processes and sends the
events.
record_tracks
Fn record_tracks
is very similar to
Fn play_tracks
and only differs in one argument.
It provides the functionality
to play
and
record
SMF
files.
If
p_tracks
is NULL, or
p_num
is 0, then nothing will be played
while recording.
The only argument that differs from
Fn play_tracks
is the
r_track
argument.
This argument specifies
the track where the recorded
events should be placed.
stop_processing
Fn stop_processing
provides the ability to abort
from a
Fn play_tracks
call or a
Fn record_tracks
call.
When called,
Fn stop_processing ,
forces the two routines
to exit with success.
Fn stop_processing
is designed for use in
processes playing or recording in
the background.
It takes one argument, the device
descriptor and returns 1 on success
and 0 on failure.
open_midi_device
Fn open_midi_device
opens the appropriate
MIDI
device for use by the
other functions.
It takes one argument which is the
play mode.
The play mode will be one of either
PLAY , RECORD
or
PLAYRECORD
It returns the descriptor for
that device.
init_midi_device
Fn init_midi_device
takes care of any initial
set up the device needs.
dev
is the device descriptor as
returned by
Fn open_midi_device .
The
hd
argument contains the
header chunk information
for the file to be processed.
The division information in the header chunk might
be especially useful.
The
reltempo
argument contains a tempo
scaling factor.
If possible any tempos
found in the playing files should
be multiplied by this value.
If that is not possible, this argument
may be ignored.
start_midi_device
Fn start_midi_device
starts the
MIDI
device
specified by
dev
playing or recording or both.
The
mode
argument determines which should occur.
It will be one of
PLAY , RECORD
or
PLAYRECORD
stop_midi_device
Fn stop_midi_device
stops the
MIDI
device
from further playing or recording.
It differs from
Fn stop_processing
in that it switches the device
off rather than stopping the
flow of data to the device.
The argument
dev
contains the descriptor for
the device as returned by
Fn open_midi_device .
mode
contains the same value that was used
in
Fn start_midi_device .
close_midi_device
Fn close_midi_device
does any clean up necessary for the
device and closes the
descriptor.
dev
is the descriptor for the device
as returned by
Fn open_midi_device .
RETURN VALUES
All functions with the exception of
Fn open_midi_device ,
which returns the descriptor number,
return 1 on success and 0 otherwise.
Fn open_midi_device
returns -1 on error.
SEE ALSO
tclm(1)
AUTHORS
Mike Durian - durian@advtech.uswest.com
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- play_tracks
-
- record_tracks
-
- stop_processing
-
- open_midi_device
-
- init_midi_device
-
- start_midi_device
-
- stop_midi_device
-
- close_midi_device
-
- RETURN VALUES
-
- SEE ALSO
-
- AUTHORS
-
This document was created by
man2html,
using the manual pages.
Time: 00:28:07 GMT, March 30, 2022